]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Add a notification focus keybinding
authorStéphane Démurget <stephane.demurget@free.fr>
Thu, 8 Nov 2012 14:24:40 +0000 (15:24 +0100)
committerStéphane Démurget <stephane.demurget@free.fr>
Thu, 8 Nov 2012 14:46:16 +0000 (15:46 +0100)
At the moment, only the mouse can be used to focus and answer a chat
notification.

This adds a new keybinding (defaults to <Super>+n) to focus and expand
the active notification.

https://bugzilla.gnome.org/show_bug.cgi?id=652082

data/50-gnome-shell-system.xml.in
data/org.gnome.shell.gschema.xml.in.in
js/ui/messageTray.js

index cb468f9349301fa7fb2bcc7ea2ab85a20929c876..92858c59dcbafdc6a44bb8d25fcdf43e13bf2ab6 100644 (file)
@@ -8,6 +8,9 @@
        <KeyListEntry name="toggle-message-tray"
                       _description="Show the message tray"/>
 
+       <KeyListEntry name="focus-active-notification"
+                      _description="Focus the active notification"/>
+
        <KeyListEntry name="toggle-application-view"
                       _description="Show all applications"/>
 
index e18685e9c76802e99cc6cbb17b2f16c00eb38ebd..eaeb01aae9eac4f6c91f7e75e107aabc33c50f09 100644 (file)
@@ -106,6 +106,13 @@ value here is from the GsmPresenceStatus enumeration.</_summary>
         Keybinding to toggle the visibility of the message tray.
       </_description>
     </key>
+    <key name="focus-active-notification" type="as">
+      <default>["&lt;Super&gt;n"]</default>
+      <_summary>Keybinding to focus the active notification</_summary>
+      <_description>
+        Keybinding to focus the active notification.
+      </_description>
+    </key>
     <key name="toggle-recording" type="as">
       <default><![CDATA[['<Control><Shift><Alt>r']]]></default>
       <_summary>Keybinding to toggle the screen recorder</_summary>
index 2bbdfe8b61108b58dcc12cc95ee9519e626136a5..2f714b0b4aa225ea627ca77878ba25ce2896b807 100644 (file)
@@ -1519,6 +1519,10 @@ const MessageTray = new Lang.Class({
                                       new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
                                       Meta.KeyBindingFlags.NONE,
                                       Lang.bind(this, this.toggleAndNavigate));
+        global.display.add_keybinding('focus-active-notification',
+                                      new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
+                                      Meta.KeyBindingFlags.NONE,
+                                      Lang.bind(this, this._expandActiveNotification));
 
         this._summaryItems = [];
         this._chatSummaryItemsCount = 0;
@@ -2338,6 +2342,13 @@ const MessageTray = new Lang.Class({
             notification.destroy(NotificationDestroyedReason.EXPIRED);
     },
 
+    _expandActiveNotification: function() {
+        if (!this._notification)
+            return;
+
+        this._expandNotification(false);
+    },
+
     _expandNotification: function(autoExpanding) {
         // Don't grab focus in notifications that are auto-expanded.
         if (!autoExpanding)